//
//  XYSegementView.h
//  XYAuto
//
//  Created by 小萌 on 2016/12/26.
//  Copyright © 2016年 Raymond~. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "XYSegementScrollView.h"

@class XYSegementView;

@protocol XYSegementViewDelegate <NSObject>
@optional
- (void)segementView:(XYSegementView *)segementView didSelectRowAtIndexPath:(NSInteger)indexPath;
@end

@protocol XYSegementViewDataSource <NSObject>
@required
- (NSInteger)numberOfRowsInXYSegementView:(UIView *)segementView;
- (UIViewController *)segementView:(XYSegementView *)segementView rowAtIndexPath:(NSInteger)indexPath;
@end

@interface XYSegementView : UIView

@property (nonatomic, weak) id<XYSegementViewDelegate> delegate;
@property (nonatomic, weak) id<XYSegementViewDataSource>dataSource;
/** 顶部滑动的高度 默认40*/
@property (nonatomic, assign) CGFloat topScrollViewHeight;
@property (nonatomic, strong) XYSegementScrollView *smallScrollView;//标题scrollView
/**父视图*/
@property (nonatomic, weak) UIViewController *parentVC;
/**是否隐藏顶部segement 默认不隐藏*/
@property (nonatomic, assign) BOOL isHideTopSegement;
/**内容边距*/
@property (nonatomic, assign) UIEdgeInsets contentInset;
/**内容视图是否可以滑动 默认YES*/
@property (nonatomic, assign) BOOL isScrollContent;
///**选中 默认选中第一个 从0开始*/
@property (nonatomic, assign) NSInteger seletedIndex;

/**
 初始化方法
 @param frame frame
 @return XYSegementView对象
 */
+ (instancetype)segementViewWithFrame:(CGRect)frame;
/**
 加载数据
 */
- (void)reloadSegementView;
@end
